home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / batchut / bmenu54.zip / BMENU54.DOC < prev    next >
Text File  |  1990-02-12  |  9KB  |  266 lines

  1.  
  2.  
  3.                      ┌─────────────────────────────────────┐
  4.                      │    ░▒▓█  Batch Menu System █▓▒░     │
  5.                      │                                     │
  6.                      │            Pop up menus             │
  7.                      │          right in your own          │
  8.                      │            batch files!             │
  9.                      │                                     │
  10.                      │  BMENU 5.4                 2/12/90  │
  11.                      │  (C) 1990 by Mark Strong            │
  12.                      └─────────────────────────────────────┘
  13.  
  14.  
  15.     The  Batch Menu System allows you to insert pop-up menus within a  batch
  16.     file.
  17.  
  18.     Similar to the Norton Utilities ASK function,   BMENU returns the error-
  19.     level of  the item selected.   BMENU allows the choice of menu location,
  20.     title, item list and optionally, color.
  21.  
  22.     For example, the command (using default black and white colors):
  23.  
  24.          bmenu 10 5 Title Choice1 Choice2 Choice3
  25.  
  26.     would produce a menu at row 10,  column 5,  with title "Title" and three
  27.     choices.  If  the user selects choice 1,  the errorlevel return is  1,
  28.     choice 2 returns errorlevel 2, and so on.  If ESC is pressed, errorlevel 0
  29.     is returned to trap a "no choice made" condition.  Control-Break (or ^C)
  30.     also returns errorlevel 0.
  31.  
  32.     You can also use quotes to use multi-word choices:
  33.  
  34.          bmenu 10 5 "My Menu" Choice1 Choice2 "Another Choice"
  35.  
  36.      or use an @file:
  37.  
  38.          bmenu @filename.ext
  39.  
  40.     The @file must have the format of one command line argument per line.
  41.     For the last example, filename.ext would contain:
  42.  
  43.         10
  44.         5
  45.         My Menu
  46.         Choice1
  47.         Choice2
  48.         Another Choice
  49.  
  50.  
  51.     Several example batch files are included to demonstrate various uses
  52.     of Bmenu, including @files and color definitions.
  53.     MULTIPLE MENUS:
  54.  
  55.     @file listings may now have multiple menus within a single file.  Simply
  56.     delimit the menus with the dollar sign ($) and then a label ($mymenu).
  57.     Then call bmenu as follows:
  58.  
  59.     bmenu @file mymenu
  60.  
  61.     Bmenu will search the @file until the label is found and read the commands
  62.     until the end of file, or the next $ menu is found (or an $end_label).  If 
  63.     you need to use the dollar sign in a menu choice, use quotes around the 
  64.     entire choice, and Bmenu will consider the line an argument rather than 
  65.     a multiple menu label.
  66.  
  67.     Nesting of menus within batch files will also work if you begin and end
  68.     the menu portion of the file with $label and $end.  The two dollar sign
  69.     labels will tell Bmenu that this is the menu definition, and it will use
  70.     that data for the menu.  Simply put the menu data at the end of the batch
  71.     file, or have a GOTO statement jump over the menu definition.  
  72.     (For example, its fine to have "BMENU @batch.bat menu1" within batch.bat)
  73.  
  74.     Comments are also allowed.  Any line beginning with a colon (;) is ignored
  75.     by bmenu.  
  76.  
  77.     Example of nested batch file menu "nested.bat" :
  78.  
  79.         echo off
  80.         goto main
  81.         ; 
  82.         ; Menu Def below
  83.         ;
  84.         $menu1
  85.         10
  86.         10
  87.         Title
  88.         Choices
  89.         Choice 2
  90.         $end_menu
  91.         ;
  92.         ; Batch file below
  93.         ;
  94.         :main
  95.         bmenu @nested.bat menu1
  96.         if errorlevel 2 goto 2
  97.         if errorlevel 1 goto 1
  98.         if errorlevel 0 goto esc
  99.         :2
  100.         echo Choices was chosen
  101.         goto end
  102.         :1
  103.         echo Choice 2 was made
  104.         goto end
  105.         :esc
  106.         echo User ESC'd the menu
  107.         :end
  108.  
  109.  
  110.     COLOR:
  111.     
  112.         User defined colors are now available on the command line.  Simply 
  113.     follow the row and column numbers with a dash then the window, menu, 
  114.     and selection bar color numbers, in decimal.  For example,
  115.  
  116.             bmenu 10 10 -3 5 65 title choice1 choice2
  117.  
  118.     would produce a cyan border with magenta menu choices and a red bar with
  119.     a blue word for the current menu choice.  The colors may also be included
  120.     in an @file, with the above example being:
  121.  
  122.            10
  123.            10
  124.            -3
  125.            5
  126.            65
  127.            title
  128.            choice1
  129.            choice2
  130.  
  131.  
  132.     The color combinations are made by adding the decimal values of the 
  133.     foreground and background colors.
  134.  
  135.                  ┌───────────────────────────────────┐
  136.                  │ ░▒▓█     Color Attributes    █▓▒░ │
  137.                  └───────────────────────────────────┘
  138.  
  139.     Foreground Colors:
  140.  
  141.     Black        0            Gray            8
  142.     Blue        1            Light Blue        9
  143.     Green        2            Light Green        10
  144.     Cyan        3            Light Cyan        11
  145.     Red        4            Light Red        12
  146.     Magenta            5                       Light Magenta            13
  147.     Brown        6            Yellow                14
  148.     Light Gray    7            White            15
  149.  
  150.  
  151.     Background Colors:
  152.     
  153.     Black        0
  154.     Blue        16
  155.     Green        32
  156.     Cyan        48
  157.     Red        64
  158.     Magenta            80
  159.     Brown        96
  160.     White        112
  161.  
  162.  
  163.     NOTES:
  164.  
  165.     Typing `bmenu' alone lists the usage of the program.
  166.  
  167.     Feel free to comment or make suggestions, but if you find the program 
  168.     useful, please register.  I appreciate the distribution via BBS's and
  169.     permission is granted to make copies of BMENU for this purpose.  Feel
  170.     free to distribute the program to friends and others who can make use
  171.     of a batch menu system.
  172.  
  173.     With the addition of multiple menu @files, Bmenu has become VERY network
  174.     compatible.  Try it instead of numerous ECHO statements for menus.
  175.  
  176.     Portions of this program Copyright 1986,1987 New Dimension Software.
  177.  
  178.     Address correspondence to:    Mark Strong
  179.                                   6029 Eastridge Lane
  180.                                   Cincinnati, OH  45247
  181.  
  182.     or CompuServe mail [70043,114]
  183.     ________________________________________________________________________
  184.  
  185.  
  186.     Update History:
  187.  
  188.     1.0    -  original offering, 3/22/89 or so?
  189.  
  190.     2.0 -  added color, if you want it, thanks to H. C. Wottle, 5/89 
  191.  
  192.     3.0 -  changed errorlevel return value so that ESC returns 0,
  193.            and choice 1 = errorlevel 1, etc.
  194.            Thanks to W. F. Hines, 11/15/89
  195.  
  196.     4.0    -  added @file capability, fixed choice handling for consistent
  197.            spacing, and cursor size,  12/04/89
  198.  
  199.     5.0    -  added optional color definition on the command line, 1/14/90
  200.     5.2    -  fixed bug in command line @file definition, spotted by T.Scott
  201.            1/29/90
  202.     5.3 -  added optional multi-menu @files, again thanks to T.Scott, 1/31/90
  203.     5.4 -  Corrected handling of ^C and Ctrl-Brk, 2/12/90
  204.  
  205.     I hope anyone reading this replaces the BMENU, BMENU2-A, BMENU2-B,
  206.     BMENU3, BMENU4, and BMENU5 files floating around with this file,
  207.     BMENU54.ZIP dated 02/12/90.
  208.  
  209.                                  Bmenu 5.4
  210.                              Registration Form
  211.  
  212.                      (C) Copyright 1990 by Mark Strong
  213.  
  214.  
  215. Name            ________________________________
  216.  
  217. Company         ________________________________
  218.  
  219. Address         ________________________________
  220.  
  221. City, State     ________________________________
  222.  
  223. Zip             ________________________________
  224.  
  225.  
  226.  
  227. Where did you obtain this copy of Bmenu 5.4? ________________________________
  228.  
  229. ____________________________________________________________________________
  230.  
  231.  
  232. Were you a user of previous Bmenu programs, and if so which version?
  233.  
  234. ___________________________________________________________________________
  235.  
  236.  
  237. Comments/Suggestions: ______________________________________________________
  238.  
  239. ____________________________________________________________________________
  240.  
  241.  
  242. The cost to register one copy of Bmenu is $10.00.  Registration entitles
  243. you to legally continue to use the program, plus written notification of 
  244. future versions.  For a contribution of $15.00 or more, you receive the above
  245. benefits plus the latest version of Bmenu or the next release, whichever is 
  246. applicable, via postage paid first class mail.  (Site licenses are also 
  247. available, write for info and include expected usage.)  Please make checks 
  248. pa